package com.cy.pj.goods.dao;

import com.cy.pj.goods.pojo.Goods;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GoodsDao {

    @Select("select * from tb_goods where id=#{id}")
    public Goods findById(Integer id);

    public List<Goods> findAll();

    @Delete("delete from tb_goods where id=#{id}")
    public Integer delete(Integer id);

    @Insert("insert into tb_goods values(null, #{name}, #{remark}, now())")
    public int insert(Goods goods);

    @Update("Update tb_goods set name = #{name}, remark = #{remark}, createdTime = now() where id = #{id}")
    public int update(Goods goods);
}
